import Global from "./global.js";
import request from "./request.js";
export default {
  gatewayPay(data) {
    let _url = Global.testPath + "/pc/remote/pay/gateway";
    return request({
      url: _url ,
      method: 'post',
      data
    })
  },
  findMeetList(data) {
    // 获取 会议室List
    let _url = Global.testPath + "/plm/meet/findMeetList";

    return request({
      url: _url,
      method: Global.HttpMethod.get,
      params: data,
    });
  },
  findMeetInfo(data) {
    // 获取 会议室详细信息
    let _url = Global.testPath + "/plm/meet/findMeetInfo";

    return request({
      url: _url,
      method: Global.HttpMethod.get,
      params: data,
    });
  },
  findLeaseUserInfo(data) {
    // 获取 当前租赁用户信息
    let _url = Global.testPath + "/plm/meet/findLeaseUserInfo";

    return request({
      url: _url,
      method: Global.HttpMethod.get,
      params: data,
    });
  },
  findLeaseMeetInfo(data) {
    // 获取 当前会议室租赁情况
    let _url = Global.testPath + "/plm/meet/findLeaseMeetInfo";

    return request({
      url: _url,
      method: Global.HttpMethod.get,
      params: data,
    });
  },
  findDayLeaseMeetInfo(data) {
    //获取 会议室指定日期租赁情况
    let _url = Global.testPath + "/plm/meet/findDayLeaseMeetInfo";

    return request({
      url: _url,
      method: Global.HttpMethod.get,
      params: data,
    });
  },
  
  
  addPlmMeetOrder(data) {
    //新增 租赁会议室订单
    let _url = Global.testPath+"/plm/meet/order/addPlmMeetOrder";
    return request({
      url: _url,
      method: Global.HttpMethod.post,
      data: data,
    });
  },
  findSiteList(data) {
    // 获取 活动场地List
    let _url = Global.testPath + "/plm/site/findSiteList";

    return request({
      url: _url,
      method: Global.HttpMethod.get,
      params: data,
    });
  },
  findDayLeaseSiteInfo(data) {
    // 获取 活动场地租指定日期租赁情况
    let _url = Global.testPath + "/plm/site/findDayLeaseSiteInfo";

    return request({
      url: _url,
      method: Global.HttpMethod.get,
      params: data,
    });
  },
  findLeaseSiteInfo(data) {
    // 获取 当前活动场地租赁情况
    let _url = Global.testPath + "/plm/site/findLeaseSiteInfo";

    return request({
      url: _url,
      method: Global.HttpMethod.get,
      params: data,
    });
  },
  findSiteInfo(data) {
    // 获取 活动场地详细信息
    let _url = Global.testPath + "/plm/site/findSiteInfo";

    return request({
      url: _url,
      method: Global.HttpMethod.get,
      params: data,
    });
  },
  addPlmSiteOrder(data) {
    //新增 租赁活动场地订单
    let _url = Global.testPath+"/plm/site/order/addPlmSiteOrder";
    return request({
      url: _url,
      method: Global.HttpMethod.post,
      data: data,
    });
  },
  //报事报修数据字典获取（软通接口复用）

  //区域list
  getAreaList(data) {

    let _url = Global.testPath + "/admin/dict/type/service_range";

    return request({
      url: _url,
      method: Global.HttpMethod.get,
      params: data,
    });
  },
  //故障设备list
  getDeviceList(data) {

    let _url = Global.testPath + "/repair/repair/device/list";

    return request({
      url: _url,
      method: Global.HttpMethod.get,
      params: data,
    });
  },
  //关联房产编号list
  getHouseList(data) {

    let _url = Global.testPath + "/config/sysprojecttype/getEstateByPhone";
    return request({
      url: _url,
      method: Global.HttpMethod.get,
      params: data,
    });
  },
//获取报事报修Page
  getRepairPage(data) {

    let _url = Global.testPath + "/repair/business/repair/page";
    return request({
      url: _url,
      method: Global.HttpMethod.get,
      params: data,
    });
  },
  //获取报事报修详情
  getRepairDetail(id) {

    let _url = Global.testPath + "/repair/business/repair/"+id;
    return request({
      url: _url,
      method: Global.HttpMethod.get,
    });
  },
  //新增报事报修（海东）
  addRepair(data) {
    //新增 租赁活动场地订单
    let _url = Global.testPath+"/repair/business/repair";
    return request({
      url: _url,
      method: Global.HttpMethod.post,
      data: data,
    });
  },
  // 公共导出文件
  ExportFile(url, obj) {
    request({
      url: Global.testPath+url,
      method: 'get',
      params: obj,
      responseType: 'blob'
    }).then(response => {
      if (!response) {
        return
      }
      let link = document.createElement('a')
      link.href = window.URL.createObjectURL(new Blob([response]))
      link.target = '_blank'
      // let filename = response.headers['Content-disposition']
      let filename = '报事报修.xlsx'
      link.download = decodeURI(filename)
      document.body.appendChild(link)
      link.click()
      document.body.removeChild(link)
    })
  }
};
